<template>
  <div>
    <div id="main" />
  </div>
</template>

<script>
import * as echarts from 'echarts'

export default {
  data() {
    return {

    }
  },

  created() {

  },

  mounted() {
    this.initEcharts()
  },

  methods: {
    initEcharts() {
      // 基于准备好的dom，初始化echarts实例
      var myChart = echarts.init(document.getElementById('main'))
      const option = {
        title: {
          text: '内卷指数'
        },
        legend: {
          data: ['吴亦凡', '蔡徐坤']
        },
        radar: {
          // shape: 'circle',
          indicator: [
            { name: '不睡觉', max: 100 },
            { name: '不要钱', max: 100 },
            { name: '拍马屁', max: 100 },
            { name: '全勤', max: 100 },
            { name: '帮助同事', max: 100 },
            { name: '打扫卫生', max: 100 }
          ]
        },
        series: [
          {
            name: '吴亦凡 vs 蔡徐坤',
            type: 'radar',
            data: [
              {
                value: [100, 100, 100, 100, 100, 50],
                name: '吴亦凡'
              },
              {
                value: [100, 100, 100, 100, 100, 100],
                name: '蔡徐坤'
              }
            ]
          }
        ]
      }
      // 绘制图表
      myChart.setOption(option)
    }
  }
}
</script>

<style scoped lang='scss'>
#main {
  width: 500px;
  height: 500px;
}
</style>
